2000W / 48V LLC Battery-Charger  V1.00

Versatile Analog to Digital Converter (VADC) driver for XMC microcontroller family. More...

Collaboration diagram for VADC:

Classes

struct  XMC_VADC_SCAN_CONFIG
 
struct  XMC_VADC_CHANNEL_CONFIG
 
struct  XMC_VADC_QUEUE_ENTRY
 
struct  XMC_VADC_QUEUE_CONFIG
 
struct  XMC_VADC_GLOBAL_CLASS
 
struct  XMC_VADC_GLOBAL_CONFIG
 
struct  XMC_VADC_GROUP_CLASS
 
struct  XMC_VADC_GROUP_EMUXCFG
 
struct  XMC_VADC_GROUP_CONFIG
 
struct  XMC_VADC_RESULT_CONFIG
 
struct  XMC_VADC_GLOBAL_DETAILED_RESULT
 
struct  XMC_VADC_DETAILED_RESULT
 

Macros

#define XMC_VADC_NUM_PORTS
 
#define XMC_VADC_NUM_RESULT_REGISTERS   (16U) /* Defines the number of result holding registers per ADC group */
 
#define XMC_VADC_NUM_CHANNELS_PER_GROUP   (8U)
 

Typedefs

typedef uint16_t XMC_VADC_RESULT_SIZE_t
 
typedef VADC_GLOBAL_TypeDef XMC_VADC_GLOBAL_t
 
typedef enum XMC_VADC_STATUS XMC_VADC_STATUS_t
 
typedef enum XMC_VADC_SR XMC_VADC_SR_t
 
typedef enum XMC_VADC_STARTMODE XMC_VADC_STARTMODE_t
 
typedef enum XMC_VADC_TRIGGER_EDGE XMC_VADC_TRIGGER_EDGE_t
 
typedef enum XMC_VADC_TRIGGER_INPUT_SELECT XMC_VADC_TRIGGER_INPUT_SELECT_t
 
typedef enum XMC_VADC_GATE_INPUT_SELECT XMC_VADC_GATE_INPUT_SELECT_t
 
typedef enum XMC_VADC_GATEMODE XMC_VADC_GATEMODE_t
 
typedef enum XMC_VADC_DMM XMC_VADC_DMM_t
 
typedef enum XMC_VADC_CONVMODE XMC_VADC_CONVMODE_t
 
typedef enum XMC_VADC_FAST_COMPARE XMC_VADC_FAST_COMPARE_t
 
typedef enum XMC_VADC_SCAN_TYPE XMC_VADC_SCAN_TYPE_t
 
typedef enum XMC_VADC_SCAN_LOAD XMC_VADC_SCAN_LOAD_t
 
typedef enum XMC_VADC_CHANNEL_CONV XMC_VADC_CHANNEL_CONV_t
 
typedef enum XMC_VADC_CHANNEL_BOUNDARY XMC_VADC_CHANNEL_BOUNDARY_t
 
typedef enum XMC_VADC_CHANNEL_BWDCH XMC_VADC_CHANNEL_BWDCH_t
 
typedef enum XMC_VADC_CHANNEL_EVGEN XMC_VADC_CHANNEL_EVGEN_t
 
typedef enum XMC_VADC_CHANNEL_REF XMC_VADC_CHANNEL_REF_t
 
typedef enum XMC_VADC_CHANNEL_BOUNDARY_CONDITION XMC_VADC_CHANNEL_BOUNDARY_CONDITION_t
 
typedef enum XMC_VADC_GLOBAL_EVENT XMC_VADC_GLOBAL_EVENT_t
 
typedef enum XMC_VADC_GROUP_POWERMODE XMC_VADC_GROUP_POWERMODE_t
 
typedef enum XMC_VADC_GROUP_STATE XMC_VADC_GROUP_STATE_t
 
typedef enum XMC_VADC_GROUP_CONV XMC_VADC_GROUP_CONV_t
 
typedef enum XMC_VADC_GROUP_ARBMODE XMC_VADC_GROUP_ARBMODE_t
 
typedef enum XMC_VADC_GROUP_EMUXMODE XMC_VADC_GROUP_EMUXMODE_t
 
typedef enum XMC_VADC_GROUP_EMUXCODE XMC_VADC_GROUP_EMUXCODE_t
 
typedef enum XMC_VADC_GROUP_IRQ XMC_VADC_GROUP_IRQ_t
 
typedef enum XMC_VADC_RESULT_ALIGN XMC_VADC_RESULT_ALIGN_t
 
typedef enum XMC_VADC_RESULT_SUBTRATION XMC_VADC_RESULT_SUBTRATION_t
 
typedef enum XMC_VADC_RESULT_REG_NR XMC_VADC_RESULT_REG_NR_t
 
typedef enum XMC_VADC_GROUP_RS_PRIORITY XMC_VADC_GROUP_RS_PRIORITY_t
 
typedef enum XMC_VADC_GROUP_BOUNDARY_FLAG_MODE XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_t
 
typedef enum XMC_VADC_BOUNDARY_SELECT XMC_VADC_BOUNDARY_SELECT_t
 
typedef enum XMC_VADC_GROUP_INDEX XMC_VADC_GROUP_INDEX_t
 
typedef enum XMC_VADC_CHANNEL_NR XMC_VADC_CHANNEL_NR_t
 
typedef enum XMC_VADC_CHANNEL_ALIAS XMC_VADC_CHANNEL_ALIAS_t
 
typedef struct XMC_VADC_SCAN_CONFIG XMC_VADC_SCAN_CONFIG_t
 
typedef XMC_VADC_SCAN_CONFIG_t XMC_VADC_BACKGROUND_CONFIG_t
 
typedef struct XMC_VADC_CHANNEL_CONFIG XMC_VADC_CHANNEL_CONFIG_t
 
typedef struct XMC_VADC_QUEUE_ENTRY XMC_VADC_QUEUE_ENTRY_t
 
typedef struct XMC_VADC_QUEUE_CONFIG XMC_VADC_QUEUE_CONFIG_t
 
typedef struct XMC_VADC_GLOBAL_CLASS XMC_VADC_GLOBAL_CLASS_t
 
typedef struct XMC_VADC_GLOBAL_CONFIG XMC_VADC_GLOBAL_CONFIG_t
 
typedef struct XMC_VADC_GROUP_CLASS XMC_VADC_GROUP_CLASS_t
 
typedef struct XMC_VADC_GROUP_EMUXCFG XMC_VADC_GROUP_EMUXCFG_t
 
typedef struct XMC_VADC_GROUP_CONFIG XMC_VADC_GROUP_CONFIG_t
 
typedef struct XMC_VADC_RESULT_CONFIG XMC_VADC_RESULT_CONFIG_t
 
typedef struct XMC_VADC_GLOBAL_DETAILED_RESULT XMC_VADC_GLOBAL_DETAILED_RESULT_t
 
typedef struct XMC_VADC_DETAILED_RESULT XMC_VADC_DETAILED_RESULT_t
 

Enumerations

enum  XMC_VADC_STATUS { XMC_VADC_STATUS_SUCCESS = 0, XMC_VADC_STATUS_ERROR }
 
enum  XMC_VADC_SR {
  XMC_VADC_SR_GROUP_SR0 = 0, XMC_VADC_SR_GROUP_SR1, XMC_VADC_SR_GROUP_SR2, XMC_VADC_SR_GROUP_SR3,
  XMC_VADC_SR_SHARED_SR0, XMC_VADC_SR_SHARED_SR1, XMC_VADC_SR_SHARED_SR2, XMC_VADC_SR_SHARED_SR3
}
 
enum  XMC_VADC_STARTMODE { XMC_VADC_STARTMODE_WFS = 0, XMC_VADC_STARTMODE_CIR, XMC_VADC_STARTMODE_CNR }
 
enum  XMC_VADC_TRIGGER_EDGE { XMC_VADC_TRIGGER_EDGE_NONE = 0, XMC_VADC_TRIGGER_EDGE_FALLING, XMC_VADC_TRIGGER_EDGE_RISING, XMC_VADC_TRIGGER_EDGE_ANY }
 
enum  XMC_VADC_TRIGGER_INPUT_SELECT {
  XMC_VADC_REQ_TR_A = 0, XMC_VADC_REQ_TR_B, XMC_VADC_REQ_TR_C, XMC_VADC_REQ_TR_D,
  XMC_VADC_REQ_TR_E, XMC_VADC_REQ_TR_F, XMC_VADC_REQ_TR_G, XMC_VADC_REQ_TR_H,
  XMC_VADC_REQ_TR_I, XMC_VADC_REQ_TR_J, XMC_VADC_REQ_TR_K, XMC_VADC_REQ_TR_L,
  XMC_VADC_REQ_TR_M, XMC_VADC_REQ_TR_N, XMC_VADC_REQ_TR_O, XMC_VADC_REQ_TR_P
}
 
enum  XMC_VADC_GATE_INPUT_SELECT {
  XMC_VADC_REQ_GT_A = 0, XMC_VADC_REQ_GT_B, XMC_VADC_REQ_GT_C, XMC_VADC_REQ_GT_D,
  XMC_VADC_REQ_GT_E, XMC_VADC_REQ_GT_F, XMC_VADC_REQ_GT_G, XMC_VADC_REQ_GT_H,
  XMC_VADC_REQ_GT_I, XMC_VADC_REQ_GT_J, XMC_VADC_REQ_GT_K, XMC_VADC_REQ_GT_L,
  XMC_VADC_REQ_GT_M, XMC_VADC_REQ_GT_N, XMC_VADC_REQ_GT_O, XMC_VADC_REQ_GT_P
}
 
enum  XMC_VADC_GATEMODE { XMC_VADC_GATEMODE_BLOCK = 0, XMC_VADC_GATEMODE_IGNORE, XMC_VADC_GATEMODE_ACTIVEHIGH, XMC_VADC_GATEMODE_ACTIVELOW }
 
enum  XMC_VADC_DMM { XMC_VADC_DMM_REDUCTION_MODE = 0, XMC_VADC_DMM_FILTERING_MODE, XMC_VADC_DMM_DIFFERENCE_MODE }
 
enum  XMC_VADC_CONVMODE { XMC_VADC_CONVMODE_12BIT = 0, XMC_VADC_CONVMODE_10BIT = 1, XMC_VADC_CONVMODE_8BIT = 2, XMC_VADC_CONVMODE_FASTCOMPARE = 5 }
 
enum  XMC_VADC_FAST_COMPARE { XMC_VADC_FAST_COMPARE_LOW = 0, XMC_VADC_FAST_COMPARE_HIGH, XMC_VADC_FAST_COMPARE_UNKNOWN }
 
enum  XMC_VADC_SCAN_TYPE { XMC_VADC_SCAN_TYPE_GROUPSCAN = 0, XMC_VADC_SCAN_TYPE_BACKGROUND }
 
enum  XMC_VADC_SCAN_LOAD { XMC_VADC_SCAN_LOAD_OVERWRITE = 0, XMC_VADC_SCAN_LOAD_COMBINE }
 
enum  XMC_VADC_CHANNEL_CONV { XMC_VADC_CHANNEL_CONV_GROUP_CLASS0 = 0, XMC_VADC_CHANNEL_CONV_GROUP_CLASS1, XMC_VADC_CHANNEL_CONV_GLOBAL_CLASS0, XMC_VADC_CHANNEL_CONV_GLOBAL_CLASS1 }
 
enum  XMC_VADC_CHANNEL_BOUNDARY { XMC_VADC_CHANNEL_BOUNDARY_GROUP_BOUND0 = 0, XMC_VADC_CHANNEL_BOUNDARY_GROUP_BOUND1, XMC_VADC_CHANNEL_BOUNDARY_GLOBAL_BOUND0, XMC_VADC_CHANNEL_BOUNDARY_GLOBAL_BOUND1 }
 
enum  XMC_VADC_CHANNEL_BWDCH { XMC_VADC_CHANNEL_BWDCH_VAGND = 0, XMC_VADC_CHANNEL_BWDCH_VAREF }
 
enum  XMC_VADC_CHANNEL_EVGEN {
  XMC_VADC_CHANNEL_EVGEN_NEVER = 0, XMC_VADC_CHANNEL_EVGEN_INBOUND = 1U, XMC_VADC_CHANNEL_EVGEN_COMPHIGH = 1U, XMC_VADC_CHANNEL_EVGEN_OUTBOUND = 2U,
  XMC_VADC_CHANNEL_EVGEN_COMPLOW = 2U, XMC_VADC_CHANNEL_EVGEN_ALWAYS = 3U
}
 
enum  XMC_VADC_CHANNEL_REF { XMC_VADC_CHANNEL_REF_INTREF = 0, XMC_VADC_CHANNEL_REF_ALT_CH0 }
 
enum  XMC_VADC_CHANNEL_BOUNDARY_CONDITION { XMC_VADC_CHANNEL_BOUNDARY_CONDITION_ABOVE_BAND = 0, XMC_VADC_CHANNEL_BOUNDARY_CONDITION_BELOW_BAND }
 
enum  XMC_VADC_GLOBAL_EVENT { XMC_VADC_GLOBAL_EVENT_BKGNDSOURCE = VADC_GLOBEFLAG_SEVGLB_Msk, XMC_VADC_GLOBAL_EVENT_RESULT = VADC_GLOBEFLAG_REVGLB_Msk }
 
enum  XMC_VADC_GROUP_POWERMODE { XMC_VADC_GROUP_POWERMODE_OFF = 0, XMC_VADC_GROUP_POWERMODE_RESERVED1, XMC_VADC_GROUP_POWERMODE_RESERVED2, XMC_VADC_GROUP_POWERMODE_NORMAL }
 
enum  XMC_VADC_GROUP_STATE { XMC_VADC_GROUP_STATE_IDLE = 0, XMC_VADC_GROUP_STATE_BUSY }
 
enum  XMC_VADC_GROUP_CONV { XMC_VADC_GROUP_CONV_STD = 0, XMC_VADC_GROUP_CONV_EMUX }
 
enum  XMC_VADC_GROUP_ARBMODE { XMC_VADC_GROUP_ARBMODE_ALWAYS = 0, XMC_VADC_GROUP_ARBMODE_ONDEMAND }
 
enum  XMC_VADC_GROUP_EMUXMODE { XMC_VADC_GROUP_EMUXMODE_SWCTRL = 0, XMC_VADC_GROUP_EMUXMODE_STEADYMODE, XMC_VADC_GROUP_EMUXMODE_SINGLEMODE, XMC_VADC_GROUP_EMUXMODE_SEQUENCEMODE }
 
enum  XMC_VADC_GROUP_EMUXCODE { XMC_VADC_GROUP_EMUXCODE_BINARY = 0, XMC_VADC_GROUP_EMUXCODE_GRAY }
 
enum  XMC_VADC_GROUP_IRQ { XMC_VADC_GROUP_IRQ_KERNEL = 0, XMC_VADC_GROUP_IRQ_SHARED }
 
enum  XMC_VADC_RESULT_ALIGN { XMC_VADC_RESULT_ALIGN_LEFT = 0, XMC_VADC_RESULT_ALIGN_RIGHT }
 
enum  XMC_VADC_RESULT_SUBTRATION {
  XMC_VADC_RESULT_SUBTRATION_12BIT_LEFT_ALIGN = 0U, XMC_VADC_RESULT_SUBTRATION_12BIT_RIGHT_ALIGN = 0U, XMC_VADC_RESULT_SUBTRATION_10BIT_LEFT_ALIGN = 2U, XMC_VADC_RESULT_SUBTRATION_10BIT_RIGHT_ALIGN = 0U,
  XMC_VADC_RESULT_SUBTRATION_8BIT_LEFT_ALIGN = 4U, XMC_VADC_RESULT_SUBTRATION_8BIT_RIGHT_ALIGN = 0U
}
 
enum  XMC_VADC_RESULT_REG_NR {
  XMC_VADC_RESULT_REG_NR0 = 0u, XMC_VADC_RESULT_REG_NR1 = 1u, XMC_VADC_RESULT_REG_NR2 = 2u, XMC_VADC_RESULT_REG_NR3 = 3u,
  XMC_VADC_RESULT_REG_NR4 = 4u, XMC_VADC_RESULT_REG_NR5 = 5u, XMC_VADC_RESULT_REG_NR6 = 6u, XMC_VADC_RESULT_REG_NR7 = 7u,
  XMC_VADC_RESULT_REG_NR8 = 8u, XMC_VADC_RESULT_REG_NR9 = 9u, XMC_VADC_RESULT_REG_NR10 = 10u, XMC_VADC_RESULT_REG_NR11 = 11u,
  XMC_VADC_RESULT_REG_NR12 = 12u, XMC_VADC_RESULT_REG_NR13 = 13u, XMC_VADC_RESULT_REG_NR14 = 14u, XMC_VADC_RESULT_REG_NR15 = 15u
}
 
enum  XMC_VADC_GROUP_RS_PRIORITY { XMC_VADC_GROUP_RS_PRIORITY_0 = 0, XMC_VADC_GROUP_RS_PRIORITY_1, XMC_VADC_GROUP_RS_PRIORITY_2, XMC_VADC_GROUP_RS_PRIORITY_3 }
 
enum  XMC_VADC_GROUP_BOUNDARY_FLAG_MODE { XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_DISABLED = 0, XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_ENABLED, XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_ENABLED_ACTIVE_LOW, XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_ENABLED_ACTIVE_HIGH }
 
enum  XMC_VADC_BOUNDARY_SELECT { XMC_VADC_BOUNDARY_SELECT_LOWER_BOUND = 0U, XMC_VADC_BOUNDARY_SELECT_UPPER_BOUND = 2U }
 
enum  XMC_VADC_GROUP_INDEX { XMC_VADC_GROUP_INDEX_0 = 0, XMC_VADC_GROUP_INDEX_1 }
 
enum  XMC_VADC_CHANNEL_NR {
  XMC_VADC_CHANNEL_NR_CH0 = 0u, XMC_VADC_CHANNEL_NR_CH1 = 1u, XMC_VADC_CHANNEL_NR_CH2 = 2u, XMC_VADC_CHANNEL_NR_CH3 = 3u,
  XMC_VADC_CHANNEL_NR_CH4 = 4u, XMC_VADC_CHANNEL_NR_CH5 = 5u, XMC_VADC_CHANNEL_NR_CH6 = 6u, XMC_VADC_CHANNEL_NR_CH7 = 7u
}
 
enum  XMC_VADC_CHANNEL_ALIAS {
  XMC_VADC_CHANNEL_ALIAS_DISABLED = -1, XMC_VADC_CHANNEL_ALIAS_CH0 = 0, XMC_VADC_CHANNEL_ALIAS_CH1 = 1, XMC_VADC_CHANNEL_ALIAS_CH2 = 2,
  XMC_VADC_CHANNEL_ALIAS_CH3 = 3, XMC_VADC_CHANNEL_ALIAS_CH4 = 4, XMC_VADC_CHANNEL_ALIAS_CH5 = 5, XMC_VADC_CHANNEL_ALIAS_CH6 = 6,
  XMC_VADC_CHANNEL_ALIAS_CH7 = 7
}
 

Functions

void XMC_VADC_GLOBAL_EnableModule (void)
 
void XMC_VADC_GLOBAL_DisableModule (void)
 
void XMC_VADC_GLOBAL_Init (XMC_VADC_GLOBAL_t *const global_ptr, const XMC_VADC_GLOBAL_CONFIG_t *config)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_EnableModuleClock (XMC_VADC_GLOBAL_t *const global_ptr)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_DisableModuleClock (XMC_VADC_GLOBAL_t *const global_ptr)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_EnableSleepMode (XMC_VADC_GLOBAL_t *const global_ptr)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_DisableSleepMode (XMC_VADC_GLOBAL_t *const global_ptr)
 
void XMC_VADC_GLOBAL_InputClassInit (XMC_VADC_GLOBAL_t *const global_ptr, const XMC_VADC_GLOBAL_CLASS_t config, const XMC_VADC_GROUP_CONV_t conv_type, const uint32_t set_num)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_ResultInit (XMC_VADC_GLOBAL_t *const global_ptr, const XMC_VADC_RESULT_CONFIG_t *config)
 
void XMC_VADC_GLOBAL_StartupCalibration (XMC_VADC_GLOBAL_t *const global_ptr)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_DisableStartupCalibration (XMC_VADC_GLOBAL_t *const global_ptr)
 
__STATIC_INLINE uint32_t XMC_VADC_GLOBAL_GetDetailedResult (XMC_VADC_GLOBAL_t *const global_ptr)
 
__STATIC_INLINE XMC_VADC_RESULT_SIZE_t XMC_VADC_GLOBAL_GetResult (XMC_VADC_GLOBAL_t *const global_ptr)
 
void XMC_VADC_GLOBAL_SetCompareValue (XMC_VADC_GLOBAL_t *const global_ptr, const XMC_VADC_RESULT_SIZE_t compare_val)
 
XMC_VADC_FAST_COMPARE_t XMC_VADC_GLOBAL_GetCompareResult (XMC_VADC_GLOBAL_t *const global_ptr)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_TriggerEvent (XMC_VADC_GLOBAL_t *const global_ptr, const uint32_t event_type)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_ClearEvent (XMC_VADC_GLOBAL_t *const global_ptr, const uint32_t event_type)
 
void XMC_VADC_GLOBAL_SetResultEventInterruptNode (XMC_VADC_GLOBAL_t *const global_ptr, XMC_VADC_SR_t sr)
 
void XMC_VADC_GLOBAL_BackgroundSetReqSrcEventInterruptNode (XMC_VADC_GLOBAL_t *const global_ptr, XMC_VADC_SR_t sr)
 
void XMC_VADC_GLOBAL_BackgroundInit (XMC_VADC_GLOBAL_t *const global_ptr, const XMC_VADC_BACKGROUND_CONFIG_t *config)
 
void XMC_VADC_GLOBAL_BackgroundSelectTrigger (XMC_VADC_GLOBAL_t *const global_ptr, const uint32_t input_num)
 
void XMC_VADC_GLOBAL_BackgroundSelectTriggerEdge (XMC_VADC_GLOBAL_t *const global_ptr, const XMC_VADC_TRIGGER_EDGE_t trigger_edge)
 
void XMC_VADC_GLOBAL_BackgroundSelectGating (XMC_VADC_GLOBAL_t *const global_ptr, const uint32_t input_num)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundSetGatingMode (XMC_VADC_GLOBAL_t *const global_ptr, XMC_VADC_GATEMODE_t mode_sel)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundEnableContinuousMode (XMC_VADC_GLOBAL_t *const global_ptr)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundDisableContinuousMode (XMC_VADC_GLOBAL_t *const global_ptr)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundTriggerConversion (XMC_VADC_GLOBAL_t *const global_ptr)
 
void XMC_VADC_GLOBAL_BackgroundAbortSequence (XMC_VADC_GLOBAL_t *const global_ptr)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundAddChannelToSequence (XMC_VADC_GLOBAL_t *const global_ptr, const uint32_t grp_num, const uint32_t ch_num)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_BackgndAddMultipleChannels (XMC_VADC_GLOBAL_t *const global_ptr, const uint32_t grp_num, const uint32_t ch_mask)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundRemoveChannelFromSequence (XMC_VADC_GLOBAL_t *const global_ptr, const uint32_t grp_num, const uint32_t ch_num)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_BackgndRemoveMultipleChannels (XMC_VADC_GLOBAL_t *const global_ptr, const uint32_t grp_num, const uint32_t ch_mask)
 
__STATIC_INLINE bool XMC_VADC_GLOBAL_BackgroundIsChannelPending (XMC_VADC_GLOBAL_t *const global_ptr, const uint32_t grp_num, const uint32_t ch_num)
 
uint32_t XMC_VADC_GLOBAL_BackgroundGetNumChannelsPending (XMC_VADC_GLOBAL_t *const global_ptr)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundTriggerReqSrcEvent (XMC_VADC_GLOBAL_t *const global_ptr)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundClearReqSrcEvent (XMC_VADC_GLOBAL_t *const global_ptr)
 
__STATIC_INLINE bool XMC_VADC_GLOBAL_BackgroundGetReqSrcEventStatus (XMC_VADC_GLOBAL_t *const global_ptr)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundEnableExternalTrigger (XMC_VADC_GLOBAL_t *const global_ptr)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundDisableExternalTrigger (XMC_VADC_GLOBAL_t *const global_ptr)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundEnableEvent (XMC_VADC_GLOBAL_t *const global_ptr)
 
__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundDisableEvent (XMC_VADC_GLOBAL_t *const global_ptr)
 

Detailed Description

Versatile Analog to Digital Converter (VADC) driver for XMC microcontroller family.

The XMC microcontroller provides a series of analog input channels connected to a cluster of Analog/Digital Converters using the Successive Approximation Register (SAR) principle to convert analog input values (voltages) to discrete digital values.

Each converter of the ADC cluster can operate independent of the others, controlled by a dedicated set of registers and triggered by a dedicated group request source. The results of each channel can be stored in a dedicated channel-specific result register or in a group-specific result register.

The Versatile Analog to Digital Converter module (VADC) of the XMC comprises a set of converter blocks that can be operated either independently or via a common request source that emulates a background converter. Each converter block is equipped with a dedicated input multiplexer and dedicated request sources, which together build separate groups.

vadc_overview_xmc1x.png

The VADC LLD is split into GLOBAL and GROUP related APIs.
GLOBAL:


GROUP:


Macro Definition Documentation

◆ XMC_VADC_NUM_CHANNELS_PER_GROUP

#define XMC_VADC_NUM_CHANNELS_PER_GROUP   (8U)

◆ XMC_VADC_NUM_PORTS

#define XMC_VADC_NUM_PORTS
Value:
(16U) /* Defines the number of hardware ports that can be configured
as triggers and gating signals */

Definition at line 290 of file xmc_vadc.h.

Referenced by XMC_VADC_GLOBAL_BackgroundSelectGating(), and XMC_VADC_GLOBAL_BackgroundSelectTrigger().

◆ XMC_VADC_NUM_RESULT_REGISTERS

#define XMC_VADC_NUM_RESULT_REGISTERS   (16U) /* Defines the number of result holding registers per ADC group */

Definition at line 293 of file xmc_vadc.h.

Typedef Documentation

◆ XMC_VADC_BACKGROUND_CONFIG_t

Type defined the scan configuration structure for background Request Source

Definition at line 889 of file xmc_vadc.h.

◆ XMC_VADC_BOUNDARY_SELECT_t

Defines the boundary select for Channel. Use XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_t for this enumeration.

◆ XMC_VADC_CHANNEL_ALIAS_t

Defines channel alias. All enum items are available for channels 0 and 1. Other Channels can accept only XMC_VADC_CHANNEL_ALIAS_DISABLED.

◆ XMC_VADC_CHANNEL_BOUNDARY_CONDITION_t

Defines the criteria for boundary flag assertion. Use XMC_VADC_CHANNEL_BOUNDARY_CONDITION_t for this enumeration.

◆ XMC_VADC_CHANNEL_BOUNDARY_t

Defines the references to boundary values used for limit checking feature. Each of these can be assigned as either an upper bound or a lower bound. Use XMC_VADC_CHANNEL_BOUNDARY_t for this enumeration.

◆ XMC_VADC_CHANNEL_BWDCH_t

Defines the voltage which the capacitor is charged to. Used in Broken wire detection feature. Use XMC_VADC_CHANNEL_BWDCH_t for this enumeration.

◆ XMC_VADC_CHANNEL_CONFIG_t

Structure initializing the VADC channel. Use type XMC_VADC_CHANNEL_CONFIG_t for this enumeration.

◆ XMC_VADC_CHANNEL_CONV_t

Defines the conversion classes that can be selected for each channel. The enumeration members holds the group or global classes. The conversion classes decides the properties of conversion, like resolution, sampling time etc Use XMC_VADC_CHANNEL_CONV_t for this enumeration.

◆ XMC_VADC_CHANNEL_EVGEN_t

Defines the criteria for event generation by the channel. Use XMC_VADC_CHANNEL_EVGEN_t for this enumeration.

◆ XMC_VADC_CHANNEL_NR_t

Defines channel All enum items are available for channels 0 and 1.

◆ XMC_VADC_CHANNEL_REF_t

Defines the reference voltage selection for conversion. Use XMC_VADC_CHANNEL_REF_t for this enumeration.

◆ XMC_VADC_CONVMODE_t

Defines the conversion mode. It defines the resolution of conversion. Use XMC_VADC_CONVMODE_t for this enumeration.

◆ XMC_VADC_DETAILED_RESULT_t

Detailed channel result structure

◆ XMC_VADC_DMM_t

Defines the conversion result handling mode. Use XMC_VADC_DMM_t for this enumeration.

◆ XMC_VADC_FAST_COMPARE_t

Defines the output of a fast compare mode. Use XMC_VADC_FAST_COMPARE_t for this enumeration.

◆ XMC_VADC_GATE_INPUT_SELECT_t

Defines the external gating input selection possibilities, to gate the conversion requests. Refer the VADC interconnects section of the reference manual for details of peripherals which can be used. Also refer xmc_vadc_map.h file for detailed definitions of the peripherals which can take the control of these enumeration items. Use XMC_VADC_GATE_INPUT_SELECT_t for this enumeration.

◆ XMC_VADC_GATEMODE_t

Defines the condition for gating the conversion requests. It can be used to set the ENGT field of ASMR/BSMR/QMR register respectively for auto_scan/background_scan/queue request sources. Use XMC_VADC_GATEMODE_t for this enumeration.

◆ XMC_VADC_GLOBAL_CLASS_t

Structure to initialize the global input class configuration. Configured parameters are sample time and conversion Mode.

◆ XMC_VADC_GLOBAL_CONFIG_t

Structure to initialize the VADC Global functions

◆ XMC_VADC_GLOBAL_DETAILED_RESULT_t

Detailed global result structure

◆ XMC_VADC_GLOBAL_EVENT_t

Defines the event which can lead to a global service request assertion. Use XMC_VADC_GLOBAL_EVENT_t for this enumeration.

◆ XMC_VADC_GLOBAL_t

Type defined the device header file vadc global register structure type to VADC type

Definition at line 301 of file xmc_vadc.h.

◆ XMC_VADC_GROUP_ARBMODE_t

Defines the request source arbiter behavior. Use XMC_VADC_GROUP_ARBMODE_t for this enumeration.

◆ XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_t

Defines the various modes for the boundary flag. Use XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_t for this enumeration.

◆ XMC_VADC_GROUP_CLASS_t

Structure to initialize the group input class configuration. Configured parameters are sample time and conversion Mode.

◆ XMC_VADC_GROUP_CONFIG_t

Group Configuration Data Structures

◆ XMC_VADC_GROUP_CONV_t

Defines the reference to sample time and conversion mode settings. Use XMC_VADC_GROUP_CONV_t for this enumeration.

◆ XMC_VADC_GROUP_EMUXCFG_t

EMUX related configuration structure.

◆ XMC_VADC_GROUP_EMUXCODE_t

Defines the EMUX channel selection encoding scheme. Use XMC_VADC_GROUP_EMUXCODE_t for this enumeration.

◆ XMC_VADC_GROUP_EMUXMODE_t

Defines the EMUX mode of operation. Use XMC_VADC_GROUP_EMUXMODE_t for this enumeration.

◆ XMC_VADC_GROUP_INDEX_t

Defines the group indices. Use XMC_VADC_GROUP_INDEX_t for this enumeration.

◆ XMC_VADC_GROUP_IRQ_t

Defines the service request set used. Use XMC_VADC_GROUP_IRQ_t for this enumeration.

◆ XMC_VADC_GROUP_POWERMODE_t

Defines the power modes of a VADC Group. Use XMC_VADC_GROUP_POWERMODE_t for this enumeration.

◆ XMC_VADC_GROUP_RS_PRIORITY_t

Defines the request source arbitration priority. Use XMC_VADC_GROUP_RS_PRIORITY_t for this enumeration.

◆ XMC_VADC_GROUP_STATE_t

Defines the status of a VADC group (also known as kernel). Use XMC_VADC_GROUP_STATE_t for this enumeration.

◆ XMC_VADC_QUEUE_CONFIG_t

Structure initializing a VADC queue request source. Use type XMC_VADC_QUEUE_CONFIG_t.

◆ XMC_VADC_QUEUE_ENTRY_t

Structure to initialize a queue entry. Use type XMC_VADC_QUEUE_ENTRY_t.

◆ XMC_VADC_RESULT_ALIGN_t

Defines the alignment of the converted result. Use XMC_VADC_RESULT_ALIGN_t for this enumeration.

◆ XMC_VADC_RESULT_CONFIG_t

Structure to initialize VADC Group result register.

◆ XMC_VADC_RESULT_REG_NR_t

◆ XMC_VADC_RESULT_SIZE_t

typedef uint16_t XMC_VADC_RESULT_SIZE_t

Type defined the converted result size to unsigned 16 bit integer

Definition at line 300 of file xmc_vadc.h.

◆ XMC_VADC_RESULT_SUBTRATION_t

◆ XMC_VADC_SCAN_CONFIG_t

Structure initializing the VADC scan request source. Use type XMC_VADC_SCAN_CONFIG_t for this structure.

◆ XMC_VADC_SCAN_LOAD_t

Defines the behavior of load event for the scan request source. Use XMC_VADC_SCAN_LOAD_t for this enumeration.

◆ XMC_VADC_SCAN_TYPE_t

Defines the type of scan request source to be used. It can choose between auto scan and background scan request source methods. Use XMC_VADC_SCAN_TYPE_t for this enumeration.

◆ XMC_VADC_SR_t

typedef enum XMC_VADC_SR XMC_VADC_SR_t

Defines the various service requests lines. Each group can raise up to 4 service requests independently. While all groups together have the possibility of raising 4 module wide service requests. Use XMC_VADC_SR_t for this enumeration.

◆ XMC_VADC_STARTMODE_t

Defines the mode of operation of a channel, when an ongoing conversion gets interrupted in between. Use XMC_VADC_STARTMODE_t for this enumeration.

◆ XMC_VADC_STATUS_t

Defines the return status after execution of VADC specific API's. Use XMC_VADC_STATUS_t for this enumeration.

◆ XMC_VADC_TRIGGER_EDGE_t

Defines the edge sensitivity of the trigger signal which can assert a conversion. Use XMC_VADC_TRIGGER_EDGE_t for this enumeration.

◆ XMC_VADC_TRIGGER_INPUT_SELECT_t

Defines the external trigger input selection possibilities, to assert a conversion. Refer the VADC interconnects section of the reference manual for details of peripherals which can be used. Also refer xmc_vadc_map.h file for detailed definitions of the peripherals which can take the control of these enumeration items. Use XMC_VADC_TRIGGER_INPUT_SELECT_t for this enumeration.

Enumeration Type Documentation

◆ XMC_VADC_BOUNDARY_SELECT

Defines the boundary select for Channel. Use XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_t for this enumeration.

Enumerator
XMC_VADC_BOUNDARY_SELECT_LOWER_BOUND 

Select the lower boundary

XMC_VADC_BOUNDARY_SELECT_UPPER_BOUND 

Selects the upper boundary

Definition at line 696 of file xmc_vadc.h.

◆ XMC_VADC_CHANNEL_ALIAS

Defines channel alias. All enum items are available for channels 0 and 1. Other Channels can accept only XMC_VADC_CHANNEL_ALIAS_DISABLED.

Enumerator
XMC_VADC_CHANNEL_ALIAS_DISABLED 
XMC_VADC_CHANNEL_ALIAS_CH0 
XMC_VADC_CHANNEL_ALIAS_CH1 
XMC_VADC_CHANNEL_ALIAS_CH2 
XMC_VADC_CHANNEL_ALIAS_CH3 
XMC_VADC_CHANNEL_ALIAS_CH4 
XMC_VADC_CHANNEL_ALIAS_CH5 
XMC_VADC_CHANNEL_ALIAS_CH6 
XMC_VADC_CHANNEL_ALIAS_CH7 

Definition at line 736 of file xmc_vadc.h.

◆ XMC_VADC_CHANNEL_BOUNDARY

Defines the references to boundary values used for limit checking feature. Each of these can be assigned as either an upper bound or a lower bound. Use XMC_VADC_CHANNEL_BOUNDARY_t for this enumeration.

Enumerator
XMC_VADC_CHANNEL_BOUNDARY_GROUP_BOUND0 

Group specific Boundary-0 value

XMC_VADC_CHANNEL_BOUNDARY_GROUP_BOUND1 

Group specific Boundary-1 value

XMC_VADC_CHANNEL_BOUNDARY_GLOBAL_BOUND0 

Module wide Boundary-0 value

XMC_VADC_CHANNEL_BOUNDARY_GLOBAL_BOUND1 

Module wide Boundary-1 value

Definition at line 501 of file xmc_vadc.h.

◆ XMC_VADC_CHANNEL_BOUNDARY_CONDITION

Defines the criteria for boundary flag assertion. Use XMC_VADC_CHANNEL_BOUNDARY_CONDITION_t for this enumeration.

Enumerator
XMC_VADC_CHANNEL_BOUNDARY_CONDITION_ABOVE_BAND 

Set Boundary condition criteria to assert above the band

XMC_VADC_CHANNEL_BOUNDARY_CONDITION_BELOW_BAND 

Set Boundary condition criteria to assert below the band

Definition at line 545 of file xmc_vadc.h.

◆ XMC_VADC_CHANNEL_BWDCH

Defines the voltage which the capacitor is charged to. Used in Broken wire detection feature. Use XMC_VADC_CHANNEL_BWDCH_t for this enumeration.

Enumerator
XMC_VADC_CHANNEL_BWDCH_VAGND 

Capacitor pre-charged to ground

XMC_VADC_CHANNEL_BWDCH_VAREF 

Capacitor pre-charged to reference voltage

Definition at line 513 of file xmc_vadc.h.

◆ XMC_VADC_CHANNEL_CONV

Defines the conversion classes that can be selected for each channel. The enumeration members holds the group or global classes. The conversion classes decides the properties of conversion, like resolution, sampling time etc Use XMC_VADC_CHANNEL_CONV_t for this enumeration.

Enumerator
XMC_VADC_CHANNEL_CONV_GROUP_CLASS0 

Conversion property set-0 specific to the group

XMC_VADC_CHANNEL_CONV_GROUP_CLASS1 

Conversion property set-1 specific to the group

XMC_VADC_CHANNEL_CONV_GLOBAL_CLASS0 

Conversion property set-0, Module wide

XMC_VADC_CHANNEL_CONV_GLOBAL_CLASS1 

Conversion property set-1, Module wide

Definition at line 488 of file xmc_vadc.h.

◆ XMC_VADC_CHANNEL_EVGEN

Defines the criteria for event generation by the channel. Use XMC_VADC_CHANNEL_EVGEN_t for this enumeration.

Enumerator
XMC_VADC_CHANNEL_EVGEN_NEVER 

No event generated

XMC_VADC_CHANNEL_EVGEN_INBOUND 

Event generated when the result is within the normal range

XMC_VADC_CHANNEL_EVGEN_COMPHIGH 

Event generated when the result of fast compare operation is high

XMC_VADC_CHANNEL_EVGEN_OUTBOUND 

Event generated when the result is outside the normal range

XMC_VADC_CHANNEL_EVGEN_COMPLOW 

Event generated when the result result of fast compare operation is low

XMC_VADC_CHANNEL_EVGEN_ALWAYS 

Event generated always after conversion - unconditionally

Definition at line 522 of file xmc_vadc.h.

◆ XMC_VADC_CHANNEL_NR

Defines channel All enum items are available for channels 0 and 1.

Enumerator
XMC_VADC_CHANNEL_NR_CH0 
XMC_VADC_CHANNEL_NR_CH1 
XMC_VADC_CHANNEL_NR_CH2 
XMC_VADC_CHANNEL_NR_CH3 
XMC_VADC_CHANNEL_NR_CH4 
XMC_VADC_CHANNEL_NR_CH5 
XMC_VADC_CHANNEL_NR_CH6 
XMC_VADC_CHANNEL_NR_CH7 

Definition at line 720 of file xmc_vadc.h.

◆ XMC_VADC_CHANNEL_REF

Defines the reference voltage selection for conversion. Use XMC_VADC_CHANNEL_REF_t for this enumeration.

Enumerator
XMC_VADC_CHANNEL_REF_INTREF 

Internal VARef

XMC_VADC_CHANNEL_REF_ALT_CH0 

External voltage available on Channel-0 of the perticular group

Definition at line 535 of file xmc_vadc.h.

◆ XMC_VADC_CONVMODE

Defines the conversion mode. It defines the resolution of conversion. Use XMC_VADC_CONVMODE_t for this enumeration.

Enumerator
XMC_VADC_CONVMODE_12BIT 

Results of conversion are 12bits wide

XMC_VADC_CONVMODE_10BIT 

Results of conversion are 10bits wide

XMC_VADC_CONVMODE_8BIT 

Results of conversion are 8bits wide

XMC_VADC_CONVMODE_FASTCOMPARE 

Input signal compared with a preset range

Definition at line 442 of file xmc_vadc.h.

◆ XMC_VADC_DMM

Defines the conversion result handling mode. Use XMC_VADC_DMM_t for this enumeration.

Enumerator
XMC_VADC_DMM_REDUCTION_MODE 

Standard Data reduction mode

XMC_VADC_DMM_FILTERING_MODE 

Provide option to select Finite Impulse Response Filter (FIR) or Infinite Impulse Response Filter (IIR)

XMC_VADC_DMM_DIFFERENCE_MODE 

Difference mode is selected

Definition at line 431 of file xmc_vadc.h.

◆ XMC_VADC_FAST_COMPARE

Defines the output of a fast compare mode. Use XMC_VADC_FAST_COMPARE_t for this enumeration.

Enumerator
XMC_VADC_FAST_COMPARE_LOW 

Input lower than than programmed reference

XMC_VADC_FAST_COMPARE_HIGH 

Input higher than than programmed reference

XMC_VADC_FAST_COMPARE_UNKNOWN 

Unknown, Conversion probably still ongoing

Definition at line 454 of file xmc_vadc.h.

◆ XMC_VADC_GATE_INPUT_SELECT

Defines the external gating input selection possibilities, to gate the conversion requests. Refer the VADC interconnects section of the reference manual for details of peripherals which can be used. Also refer xmc_vadc_map.h file for detailed definitions of the peripherals which can take the control of these enumeration items. Use XMC_VADC_GATE_INPUT_SELECT_t for this enumeration.

Enumerator
XMC_VADC_REQ_GT_A 

Gating select signal A

XMC_VADC_REQ_GT_B 

Gating select signal B

XMC_VADC_REQ_GT_C 

Gating select signal C

XMC_VADC_REQ_GT_D 

Gating select signal D

XMC_VADC_REQ_GT_E 

Gating select signal E

XMC_VADC_REQ_GT_F 

Gating select signal F

XMC_VADC_REQ_GT_G 

Gating select signal G

XMC_VADC_REQ_GT_H 

Gating select signal H

XMC_VADC_REQ_GT_I 

Gating select signal I

XMC_VADC_REQ_GT_J 

Gating select signal J

XMC_VADC_REQ_GT_K 

Gating select signal K

XMC_VADC_REQ_GT_L 

Gating select signal L

XMC_VADC_REQ_GT_M 

Gating select signal M

XMC_VADC_REQ_GT_N 

Gating select signal N

XMC_VADC_REQ_GT_O 

Gating select signal O

XMC_VADC_REQ_GT_P 

Gating select signal P

Definition at line 394 of file xmc_vadc.h.

◆ XMC_VADC_GATEMODE

Defines the condition for gating the conversion requests. It can be used to set the ENGT field of ASMR/BSMR/QMR register respectively for auto_scan/background_scan/queue request sources. Use XMC_VADC_GATEMODE_t for this enumeration.

Enumerator
XMC_VADC_GATEMODE_BLOCK 

External triggers are permanently blocked

XMC_VADC_GATEMODE_IGNORE 

External triggers are unconditionally passed

XMC_VADC_GATEMODE_ACTIVEHIGH 

External trigger is passed only if the gate signal is high

XMC_VADC_GATEMODE_ACTIVELOW 

External trigger is passed only if the gate signal is low

Definition at line 420 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_EVENT

Defines the event which can lead to a global service request assertion. Use XMC_VADC_GLOBAL_EVENT_t for this enumeration.

Enumerator
XMC_VADC_GLOBAL_EVENT_BKGNDSOURCE 

Background scan request source event

XMC_VADC_GLOBAL_EVENT_RESULT 

Global result event

Definition at line 555 of file xmc_vadc.h.

◆ XMC_VADC_GROUP_ARBMODE

Defines the request source arbiter behavior. Use XMC_VADC_GROUP_ARBMODE_t for this enumeration.

Enumerator
XMC_VADC_GROUP_ARBMODE_ALWAYS 

Arbiter runs all the time

XMC_VADC_GROUP_ARBMODE_ONDEMAND 

Arbiter runs only if a conversion request is asserted by any of the request sources

Definition at line 594 of file xmc_vadc.h.

◆ XMC_VADC_GROUP_BOUNDARY_FLAG_MODE

Defines the various modes for the boundary flag. Use XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_t for this enumeration.

Enumerator
XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_DISABLED 

Disable boundary flag

XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_ENABLED 

Always enable boundary

XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_ENABLED_ACTIVE_LOW 

Enable boundary flag when gate level is 0

XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_ENABLED_ACTIVE_HIGH 

Enable boundary flag when gate level is 1

Definition at line 684 of file xmc_vadc.h.

◆ XMC_VADC_GROUP_CONV

Defines the reference to sample time and conversion mode settings. Use XMC_VADC_GROUP_CONV_t for this enumeration.

Enumerator
XMC_VADC_GROUP_CONV_STD 

Settings pertaining to channels directly attached to VADC module

XMC_VADC_GROUP_CONV_EMUX 

Settings pertaining to channels connected to VADC via EMUX

Definition at line 585 of file xmc_vadc.h.

◆ XMC_VADC_GROUP_EMUXCODE

Defines the EMUX channel selection encoding scheme. Use XMC_VADC_GROUP_EMUXCODE_t for this enumeration.

Enumerator
XMC_VADC_GROUP_EMUXCODE_BINARY 

A linearly incrementing code serves are MUX-SEL

XMC_VADC_GROUP_EMUXCODE_GRAY 

The MUX-SEL is gray encoded

Definition at line 615 of file xmc_vadc.h.

◆ XMC_VADC_GROUP_EMUXMODE

Defines the EMUX mode of operation. Use XMC_VADC_GROUP_EMUXMODE_t for this enumeration.

Enumerator
XMC_VADC_GROUP_EMUXMODE_SWCTRL 

Perform EMUX in Software control mode

XMC_VADC_GROUP_EMUXMODE_STEADYMODE 

Perform EMUX in Steady mode (Use EMUX set value)

XMC_VADC_GROUP_EMUXMODE_SINGLEMODE 

Perform EMUX in Single step mode

XMC_VADC_GROUP_EMUXMODE_SEQUENCEMODE 

Perform EMUX in Sequence mode

Definition at line 604 of file xmc_vadc.h.

◆ XMC_VADC_GROUP_INDEX

Defines the group indices. Use XMC_VADC_GROUP_INDEX_t for this enumeration.

Enumerator
XMC_VADC_GROUP_INDEX_0 
XMC_VADC_GROUP_INDEX_1 

Definition at line 706 of file xmc_vadc.h.

◆ XMC_VADC_GROUP_IRQ

Defines the service request set used. Use XMC_VADC_GROUP_IRQ_t for this enumeration.

Enumerator
XMC_VADC_GROUP_IRQ_KERNEL 

Refers to Group specific service request

XMC_VADC_GROUP_IRQ_SHARED 

Refers to Module wide service request

Definition at line 624 of file xmc_vadc.h.

◆ XMC_VADC_GROUP_POWERMODE

Defines the power modes of a VADC Group. Use XMC_VADC_GROUP_POWERMODE_t for this enumeration.

Enumerator
XMC_VADC_GROUP_POWERMODE_OFF 

Group is powered down

XMC_VADC_GROUP_POWERMODE_RESERVED1 

Reserved

XMC_VADC_GROUP_POWERMODE_RESERVED2 

Reserved

XMC_VADC_GROUP_POWERMODE_NORMAL 

Group is powered up

Definition at line 564 of file xmc_vadc.h.

◆ XMC_VADC_GROUP_RS_PRIORITY

Defines the request source arbitration priority. Use XMC_VADC_GROUP_RS_PRIORITY_t for this enumeration.

Enumerator
XMC_VADC_GROUP_RS_PRIORITY_0 

Lowest priority for the request source

XMC_VADC_GROUP_RS_PRIORITY_1 

Second lowest priority for the request source

XMC_VADC_GROUP_RS_PRIORITY_2 

Second highest priority for the request source

XMC_VADC_GROUP_RS_PRIORITY_3 

Highest priority for the request source

Definition at line 673 of file xmc_vadc.h.

◆ XMC_VADC_GROUP_STATE

Defines the status of a VADC group (also known as kernel). Use XMC_VADC_GROUP_STATE_t for this enumeration.

Enumerator
XMC_VADC_GROUP_STATE_IDLE 

Idle and can convert if requested

XMC_VADC_GROUP_STATE_BUSY 

Busy with an ongoing conversion

Definition at line 575 of file xmc_vadc.h.

◆ XMC_VADC_RESULT_ALIGN

Defines the alignment of the converted result. Use XMC_VADC_RESULT_ALIGN_t for this enumeration.

Enumerator
XMC_VADC_RESULT_ALIGN_LEFT 

Always align result to left

XMC_VADC_RESULT_ALIGN_RIGHT 

Always align result to right

Definition at line 633 of file xmc_vadc.h.

◆ XMC_VADC_RESULT_REG_NR

Enumerator
XMC_VADC_RESULT_REG_NR0 
XMC_VADC_RESULT_REG_NR1 
XMC_VADC_RESULT_REG_NR2 
XMC_VADC_RESULT_REG_NR3 
XMC_VADC_RESULT_REG_NR4 
XMC_VADC_RESULT_REG_NR5 
XMC_VADC_RESULT_REG_NR6 
XMC_VADC_RESULT_REG_NR7 
XMC_VADC_RESULT_REG_NR8 
XMC_VADC_RESULT_REG_NR9 
XMC_VADC_RESULT_REG_NR10 
XMC_VADC_RESULT_REG_NR11 
XMC_VADC_RESULT_REG_NR12 
XMC_VADC_RESULT_REG_NR13 
XMC_VADC_RESULT_REG_NR14 
XMC_VADC_RESULT_REG_NR15 

Definition at line 650 of file xmc_vadc.h.

◆ XMC_VADC_RESULT_SUBTRATION

Enumerator
XMC_VADC_RESULT_SUBTRATION_12BIT_LEFT_ALIGN 

Always align result to left

XMC_VADC_RESULT_SUBTRATION_12BIT_RIGHT_ALIGN 

Always align result to right

XMC_VADC_RESULT_SUBTRATION_10BIT_LEFT_ALIGN 

Always align result to left

XMC_VADC_RESULT_SUBTRATION_10BIT_RIGHT_ALIGN 

Always align result to right

XMC_VADC_RESULT_SUBTRATION_8BIT_LEFT_ALIGN 

Always align result to left

XMC_VADC_RESULT_SUBTRATION_8BIT_RIGHT_ALIGN 

Always align result to right

Definition at line 639 of file xmc_vadc.h.

◆ XMC_VADC_SCAN_LOAD

Defines the behavior of load event for the scan request source. Use XMC_VADC_SCAN_LOAD_t for this enumeration.

Enumerator
XMC_VADC_SCAN_LOAD_OVERWRITE 

The old set of channels is discarded in favor of the new set awaiting conversion

XMC_VADC_SCAN_LOAD_COMBINE 

The new set of channels are combined with the pending channels from previous set

Definition at line 474 of file xmc_vadc.h.

◆ XMC_VADC_SCAN_TYPE

Defines the type of scan request source to be used. It can choose between auto scan and background scan request source methods. Use XMC_VADC_SCAN_TYPE_t for this enumeration.

Enumerator
XMC_VADC_SCAN_TYPE_GROUPSCAN 

Auto scan mode of operation selected. Also called as Group scan

XMC_VADC_SCAN_TYPE_BACKGROUND 

Background scan mode of operation selected. Also called as Global scan

Definition at line 465 of file xmc_vadc.h.

◆ XMC_VADC_SR

Defines the various service requests lines. Each group can raise up to 4 service requests independently. While all groups together have the possibility of raising 4 module wide service requests. Use XMC_VADC_SR_t for this enumeration.

Enumerator
XMC_VADC_SR_GROUP_SR0 

Group specific Service Request-0

XMC_VADC_SR_GROUP_SR1 

Group specific Service Request-1

XMC_VADC_SR_GROUP_SR2 

Group specific Service Request-2

XMC_VADC_SR_GROUP_SR3 

Group specific Service Request-3

XMC_VADC_SR_SHARED_SR0 

Module Wide Common Service Request-0

XMC_VADC_SR_SHARED_SR1 

Module Wide Common Service Request-1

XMC_VADC_SR_SHARED_SR2 

Module Wide Common Service Request-2

XMC_VADC_SR_SHARED_SR3 

Module Wide Common Service Request-3

Definition at line 326 of file xmc_vadc.h.

◆ XMC_VADC_STARTMODE

Defines the mode of operation of a channel, when an ongoing conversion gets interrupted in between. Use XMC_VADC_STARTMODE_t for this enumeration.

Enumerator
XMC_VADC_STARTMODE_WFS 

An ongoing conversion completes without interruption

XMC_VADC_STARTMODE_CIR 

An ongoing conversion can be interrupted and resumed later

XMC_VADC_STARTMODE_CNR 

An ongoing conversion can be interrupted and never resumed

Definition at line 342 of file xmc_vadc.h.

◆ XMC_VADC_STATUS

Defines the return status after execution of VADC specific API's. Use XMC_VADC_STATUS_t for this enumeration.

Enumerator
XMC_VADC_STATUS_SUCCESS 

Returned when the API has been able to fulfill the callers request

XMC_VADC_STATUS_ERROR 

Returned when the API cannot fulfill the request

Definition at line 315 of file xmc_vadc.h.

◆ XMC_VADC_TRIGGER_EDGE

Defines the edge sensitivity of the trigger signal which can assert a conversion. Use XMC_VADC_TRIGGER_EDGE_t for this enumeration.

Enumerator
XMC_VADC_TRIGGER_EDGE_NONE 

No external trigger. Conversion request can be asserted by software

XMC_VADC_TRIGGER_EDGE_FALLING 

The falling edge of the external trigger can assert conversion request

XMC_VADC_TRIGGER_EDGE_RISING 

The rising edge of the external trigger can assert conversion request

XMC_VADC_TRIGGER_EDGE_ANY 

Both the edges can assert conversion request

Definition at line 353 of file xmc_vadc.h.

◆ XMC_VADC_TRIGGER_INPUT_SELECT

Defines the external trigger input selection possibilities, to assert a conversion. Refer the VADC interconnects section of the reference manual for details of peripherals which can be used. Also refer xmc_vadc_map.h file for detailed definitions of the peripherals which can take the control of these enumeration items. Use XMC_VADC_TRIGGER_INPUT_SELECT_t for this enumeration.

Enumerator
XMC_VADC_REQ_TR_A 

Trigger select signal A

XMC_VADC_REQ_TR_B 

Trigger select signal B

XMC_VADC_REQ_TR_C 

Trigger select signal C

XMC_VADC_REQ_TR_D 

Trigger select signal D

XMC_VADC_REQ_TR_E 

Trigger select signal E

XMC_VADC_REQ_TR_F 

Trigger select signal F

XMC_VADC_REQ_TR_G 

Trigger select signal G

XMC_VADC_REQ_TR_H 

Trigger select signal H

XMC_VADC_REQ_TR_I 

Trigger select signal I

XMC_VADC_REQ_TR_J 

Trigger select signal J

XMC_VADC_REQ_TR_K 

Trigger select signal K

XMC_VADC_REQ_TR_L 

Trigger select signal L

XMC_VADC_REQ_TR_M 

Trigger select signal M

XMC_VADC_REQ_TR_N 

Trigger select signal N

XMC_VADC_REQ_TR_O 

Trigger select signal O

XMC_VADC_REQ_TR_P 

Trigger select signal P

Definition at line 367 of file xmc_vadc.h.

Function Documentation

◆ XMC_VADC_GLOBAL_BackgndAddMultipleChannels()

__STATIC_INLINE void XMC_VADC_GLOBAL_BackgndAddMultipleChannels ( XMC_VADC_GLOBAL_t *const  global_ptr,
const uint32_t  grp_num,
const uint32_t  ch_mask 
)
Parameters
global_ptrPointer to the VADC module
grp_numID of the VADC group whose unprioritized channels have been assigned to background scan
ch_maskMask word indicating channels which form part of scan conversion sequence Bit location 0/1/2/3/4/5/6/7 represents channels-0/1/2/3/4/5/6/7 respectively. To Add the channel to the scan sequence enable the respective bit. Passing a 0x0 will clear all the previously selected channels
Range: [0x0 to 0xFF]
Returns
None
Description:
Adds multiple channels to the scan sequence.

Call this API to insert a multiple channels into the scan request source. This will be added to a scan sequence. The added channels will be a part of the conversion sequence when the next load event occurs. A call to this API would configure the register bit fields of BRSSEL.
Related APIs:
XMC_VADC_GLOBAL_BackgroundAddChannelToSequence()

Definition at line 3549 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_BackgndRemoveMultipleChannels()

__STATIC_INLINE void XMC_VADC_GLOBAL_BackgndRemoveMultipleChannels ( XMC_VADC_GLOBAL_t *const  global_ptr,
const uint32_t  grp_num,
const uint32_t  ch_mask 
)
Parameters
global_ptrPointer to the VADC module
grp_numID of the VADC group whose unprioritized channels have been assigned to background scan
ch_maskMask word indicating channels which form part of scan conversion sequence Bit location 0/1/2/3/4/5/6/7 represents channels-0/1/2/3/4/5/6/7 respectively. To Add the channel to the scan sequence enable the respective bit. Passing a 0x0 will clear all the previously selected channels
Range: [0x0 to 0xFF]
Returns
None
Description:
Removes multiple channels to the scan sequence.

Call this API to insert a multiple channels into the scan request source. This will be added to a scan sequence. The added channels will be a part of the conversion sequence when the next load event occurs. A call to this API would configure the register bit fields of BRSSEL.
Related APIs:
XMC_VADC_GLOBAL_BackgroundAddChannelToSequence()

Definition at line 3608 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_BackgroundAbortSequence()

void XMC_VADC_GLOBAL_BackgroundAbortSequence ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrPointer to the VADC module
Returns
None
Description:
Aborts an ongoing background scan conversion(sequence).

An ongoing sequence can be aborted at any time. The scan unit picks the pending channels one by one from a pending register and requests for their conversion. This API essentially clears the channel pending register thus creating an illusion that there are no more channels left in the sequence. A call to this API would configure the registers BRSMR, BRSCTRL, GxARBPR(if group is available) to abort the current scan sequence.
Related APIs:
None.

Definition at line 1316 of file xmc_vadc.c.

◆ XMC_VADC_GLOBAL_BackgroundAddChannelToSequence()

__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundAddChannelToSequence ( XMC_VADC_GLOBAL_t *const  global_ptr,
const uint32_t  grp_num,
const uint32_t  ch_num 
)
Parameters
global_ptrPointer to the VADC module
grp_numID of the VADC group whose unprioritized channels have been assigned to background scan Request source
ch_numThe unprioritized channel meant to be added to the scan sequence
Range: [0x0 to 0x7]
Returns
None
Description:
Adds a channel to the background scan sequence.

Call this API to insert a new single channel into the background scan request source. This will be added to the scan sequence. The added channel will be part of the conversion sequence when the next load event occurs. A call to this API would configure the register bit fields of BRSSEL.
Related APIs:
XMC_VADC_GLOBAL_BackgroundAddMultipleChannels()

Definition at line 3517 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_BackgroundClearReqSrcEvent()

__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundClearReqSrcEvent ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrPointer to the VADC module
Returns
None
Description:
Acknowledges the background scan conversion complete request source event.

This API will clear the request source event that occurred. This will clear a interrupt if it was raised. A call to this API would configure the register bit field GLOBEFLAG.SEVGLB
Related APIs:
XMC_VADC_GLOBAL_BackgroundTriggerReqSrcEvent()

Definition at line 3698 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_BackgroundDisableContinuousMode()

__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundDisableContinuousMode ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrPointer to the VADC module
Returns
None
Description:
Disables continuous conversion mode.

Typically for a Background request source to generate conversion request, either a hardware trigger or a software request is a pre-requisite. Using autoscan feature it is possible to start the conversion once and allow the sequence to repeat without any further triggers. Once all channels belonging to a Background request source have been converted, a request source completion event is generated. Generation of this event can restart the Background sequence. By invoking this API the Autoscan mode of operations is disabled. A call to this API would configure the register bit field BRSMR.SCAN.
Related APIs:
XMC_VADC_GLOBAL_BackgroundEnableContinuousMode()

Definition at line 3455 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_BackgroundDisableEvent()

__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundDisableEvent ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrPointer to the VADC module
Returns
None
Description:
Disables the background scan request source event .
By using this API the request source event will be deactivated for the background scan request source. Other configurations w.r.t service node pointer are not done in this API. A call to this API would configure the register bit field BRSMR.ENSI.
Related APIs:
XMC_VADC_GROUP_BackgroundEnableEvent(),
XMC_VADC_GLOBAL_BackgroundSetReqSrcEventInterruptNode()

Definition at line 3803 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_BackgroundDisableExternalTrigger()

__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundDisableExternalTrigger ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrPointer to the VADC module
Returns
None
Description:
Disables the trigger for background scan request source.
By using this API the trigger will be deactivated for the background scan request source. This will just deactivate the H/W trigger for the background scan request source. If any configuration was done to select the trigger input in BRSCTRL will be not be effected. A call to this API would configure the register bit field BRSMR.ENTR.
Related APIs:
XMC_VADC_GLOBAL_BackgroundEnableExternalTrigger()

Definition at line 3761 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_BackgroundEnableContinuousMode()

__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundEnableContinuousMode ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrPointer to the VADC module
Returns
None
Description:
Enables continuous conversion mode.

Typically for a Background request source to generate conversion request, either a hardware trigger or a software request is needed. Using autoscan (continuous conversion)feature it is possible to start the conversion once and allow the sequence to repeat without any further triggers. Once all channels belonging to a Background request source have been converted, a request source completion event is generated. Generation of this event can restart the Background configure sequence. Every request source event will cause a load event to occur. A call to this API would access the register bit field BRSMR.SCAN.
Related APIs:
XMC_VADC_GROUP_BackgroundDisableContinuousMode()

Definition at line 3432 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_BackgroundEnableEvent()

__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundEnableEvent ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrPointer to the VADC module
Returns
None
Description:
Enables the background scan request source event .
By using this API the request source event will be activated for the background scan request source. Other configurations w.r.t service node pointer are not done in this API. A call to this API would configure the register bit field BRSMR.ENSI.
Related APIs:
XMC_VADC_GLOBAL_BackgroundEnableEvent(),
XMC_VADC_GLOBAL_BackgroundSetReqSrcEventInterruptNode()

Definition at line 3782 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_BackgroundEnableExternalTrigger()

__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundEnableExternalTrigger ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrPointer to the VADC module
Returns
None
Description:
Enables the trigger for background scan request source.

By using this API the trigger will be activated for the scan request source. The trigger signal and trigger edge will be selected from the BRSCTRL register. The Selection of a input will be done by XMC_VADC_GLOBAL_BackgroundSelectTrigger(). A call to this API would configure the register bit field BRSMR.ENTR.
Related APIs:
XMC_VADC_GLOBAL_BackgroundSelectTrigger()
XMC_VADC_GLOBAL_BackgroundDisableExternalTrigger()

Definition at line 3739 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_BackgroundGetNumChannelsPending()

uint32_t XMC_VADC_GLOBAL_BackgroundGetNumChannelsPending ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrPointer to the VADC module
Returns

uint32_t Returns the total channels pending for conversion.
Range: [0x0 to (0x8*number of groups)]
Description:
Returns the number of pending channels.

This API will read the pending channels register and will return the number of channels that are awaiting conversion. When a load event occurs the scan sequence is pushed to a pending conversion register. From the pending register the channels are taken up by the converter. When the API is called it would return the total number of channels pending (BRSPND[grp_num]).
Related APIs:
XMC_VADC_GLOBAL_BackgroundIsChannelPending()

Definition at line 1359 of file xmc_vadc.c.

◆ XMC_VADC_GLOBAL_BackgroundGetReqSrcEventStatus()

__STATIC_INLINE bool XMC_VADC_GLOBAL_BackgroundGetReqSrcEventStatus ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrPointer to the VADC module
Returns
bool returns true if the service request event is raised. returns false if the service request event was not raised.
Description:
Determines if the request source event is asserted.
This API will get the status of the background scan request source event. Will return a true if the event has occurred for background scan. A call to this API would configure the register bit field GLOBEFLAG.SEVGLB.
Related APIs:
None.

Definition at line 3719 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_BackgroundInit()

void XMC_VADC_GLOBAL_BackgroundInit ( XMC_VADC_GLOBAL_t *const  global_ptr,
const XMC_VADC_BACKGROUND_CONFIG_t *  config 
)
Parameters
global_ptrPointer to the VADC module
configPointer to initialization data structure
Description:
Initializes the Background scan functional block.

The BACKGROUND SCAN request source functional block converts channels of all VADC groups that have not been assigned as a priority channel (priority channels can be converted only by queue and scan). Background Scan request source converts the unprioritized channels. Unprioritized channels however can also be used with queue and scan. But a channel which is prioritized can not be used with background request source.
Related APIs:
XMC_VADC_GROUP_BackgroundEnableArbitrationSlot()
XMC_VADC_GROUP_BackgroundDisableArbitrationSlot()
XMC_VADC_GLOBAL_BackgroundSelectTrigger()
XMC_VADC_GLOBAL_BackgroundSelectGating()

Definition at line 1205 of file xmc_vadc.c.

◆ XMC_VADC_GLOBAL_BackgroundIsChannelPending()

__STATIC_INLINE bool XMC_VADC_GLOBAL_BackgroundIsChannelPending ( XMC_VADC_GLOBAL_t *const  global_ptr,
const uint32_t  grp_num,
const uint32_t  ch_num 
)
Parameters
global_ptrPointer to the VADC module
grp_numID of the VADC group whose unprioritized channels have been assigned to background scan RS
ch_numThe channel being audited for completion of conversion
Range: [0x0 to 0x7]
Returns
bool returns true if the channel is pending conversion else returns false
Description:
Determine if the channel is pending.

This API will check if the Channel in question is awaiting conversion in the current arbitration round. When a load event occurs the scan sequence is pushed to a pending conversion register. From the pending register the channels are taken up by the converter. This API would return true if the channel is found in the pending register (BRSPND[grp_num]).
Related APIs:
XMC_VADC_GLOBAL_BackgroundGetNumChannelsPending()

Definition at line 3635 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_BackgroundRemoveChannelFromSequence()

__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundRemoveChannelFromSequence ( XMC_VADC_GLOBAL_t *const  global_ptr,
const uint32_t  grp_num,
const uint32_t  ch_num 
)
Parameters
global_ptrPointer to the VADC module
grp_numID of the VADC group whose unprioritized channels have been assigned to background scan Request source
ch_numThe unprioritized channel meant to be added to the scan sequence
Range: [0x0 to 0x7]
Returns
None
Description:
Removes a channel to the background scan sequence.

Call this API to insert a new single channel into the background scan request source. This will be added to the scan sequence. The added channel will be part of the conversion sequence when the next load event occurs. A call to this API would configure the register bit fields of BRSSEL.
Related APIs:
XMC_VADC_GLOBAL_BackgroundAddChannelToSequence()

Definition at line 3576 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_BackgroundSelectGating()

void XMC_VADC_GLOBAL_BackgroundSelectGating ( XMC_VADC_GLOBAL_t *const  global_ptr,
const uint32_t  input_num 
)
Parameters
global_ptrPointer to the VADC module
input_numModule input signal meant to be selected as gating input Accepts enum XMC_VADC_GATE_INPUT_SELECT_t
Returns
None
Description:
Select Gating signal for Background request source.

Passage of the trigger input to the request source can be controlled via a gating signal. Any one of the 16 input lines can be chosen as a gating signal. Trigger signal can be given to the Background request source only when the gating signal's active level is detected. Additionally the GxBRSMR.ENGT has to be configured for the gating signal's active level. A call to this API would configure the register bit field BRSCTRL.GTSEL.
Related APIs:
XMC_VADC_GLOBAL_BackgroundSelectTrigger()

Definition at line 1301 of file xmc_vadc.c.

◆ XMC_VADC_GLOBAL_BackgroundSelectTrigger()

void XMC_VADC_GLOBAL_BackgroundSelectTrigger ( XMC_VADC_GLOBAL_t *const  global_ptr,
const uint32_t  input_num 
)
Parameters
global_ptrPointer to the VADC module
input_numChoice of the input earmarked as a trigger line Accepts enum XMC_VADC_TRIGGER_INPUT_SELECT_t
Returns
None
Description:
Select Trigger signal for Background request source.

A Background request source will raise conversion request only if there were either a request from application or occurrence of a hardware trigger. This API selects one of the 16 input lines as a trigger line. This is needed when a hardware trigger is needed for the conversion of the Background request source. Refer to the reference manual to determine the signal that needs to be connected. A call to this API would configure the register bit field BRSCTRL.XTSEL.
Related APIs:
XMC_VADC_GLOBAL_BackgroundSelectGating()
XMC_VADC_GLOBAL_BackgroundEnableExternalTrigger()

Definition at line 1267 of file xmc_vadc.c.

◆ XMC_VADC_GLOBAL_BackgroundSelectTriggerEdge()

void XMC_VADC_GLOBAL_BackgroundSelectTriggerEdge ( XMC_VADC_GLOBAL_t *const  global_ptr,
const XMC_VADC_TRIGGER_EDGE_t  trigger_edge 
)
Parameters
global_ptrPointer to the VADC module
trigger_edgeSelect the trigger edge
Returns
None
Description:
Select Trigger edge for Background request source.

A Background request source will raise conversion request only if there were either a request from application or occurrence of a hardware trigger. This API selects one of the 4 possible values for the trigger edge. This is needed when a hardware trigger is needed for the conversion of the Background request source. A call to this API would configure the register bit field BRSCTRL.XTMODE.
Related APIs:
XMC_VADC_GLOBAL_BackgroundSelectGating()
XMC_VADC_GLOBAL_BackgroundEnableExternalTrigger()

Definition at line 1283 of file xmc_vadc.c.

◆ XMC_VADC_GLOBAL_BackgroundSetGatingMode()

__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundSetGatingMode ( XMC_VADC_GLOBAL_t *const  global_ptr,
XMC_VADC_GATEMODE_t  mode_sel 
)
Parameters
global_ptrPointer to the VADC module
mode_selSelect how the gating is applied to the background scan request source
Returns
None

Details of function
Selects the gating mode of background request source.

Passage of the trigger input to the request source can be controlled via a gating signal. This API determines how the gating signal behaves, either active low or active high. If gating signal needs to ignored XMC_VADC_GATEMODE_IGNORE should be used as the mode_sel. A call to this API would configure the register bit field BRSMR.ENGT.

Related APIs:
XMC_VADC_GLOBAL_BackgroundSelectGating();

Definition at line 3402 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_BackgroundSetReqSrcEventInterruptNode()

void XMC_VADC_GLOBAL_BackgroundSetReqSrcEventInterruptNode ( XMC_VADC_GLOBAL_t *const  global_ptr,
XMC_VADC_SR_t  sr 
)
Parameters
global_ptrConstant pointer to the VADC module
srThe service request to which the global request source event is connected. Refer XMC_VADC_SR_t enum
Returns
None
Description:
Binds the background request source event to one of the 4 shared service requests.

This API binds the background request source event to one of the 4 module wide shared service requests. Sets GLOBEVNP register with the corresponding sr line.
Related APIs:
XMC_VADC_GLOBAL_SetResultEventInterruptNode()

Definition at line 430 of file xmc_vadc.c.

◆ XMC_VADC_GLOBAL_BackgroundTriggerConversion()

__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundTriggerConversion ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrPointer to the VADC module
Returns
None
Description:
Generates conversion request (Software initiated conversion).

A conversion request can be raised either upon detection of a hardware trigger, or by software. This API forces the scan unit to generate a conversion request to the analog converter. It is assumed that the background scan has already been filled up with entries. A call to this API would set the register bit field BRSMR.LDEV.
Related APIs:
None.

Definition at line 3475 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_BackgroundTriggerReqSrcEvent()

__STATIC_INLINE void XMC_VADC_GLOBAL_BackgroundTriggerReqSrcEvent ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrPointer to the VADC module
Returns
None
Description:
Manually asserts the conversion complete request source event.

This API will set the request source event for background scan. This will trigger a interrupt if the service node pointer for the scan has been configured. A call to this API would configure the register bit field GLOBEFLAG.SEVGLB.
Related APIs:
None.

Definition at line 3679 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_ClearEvent()

__STATIC_INLINE void XMC_VADC_GLOBAL_ClearEvent ( XMC_VADC_GLOBAL_t *const  global_ptr,
const uint32_t  event_type 
)
Parameters
global_ptrConstant pointer to the VADC module
event_typeEvent that must be acknowledged Use the enum XMC_VADC_GLOBAL_EVENT_t to create a mask to be used with this argument
Returns
None
Description:
Acknowledges an event that has been asserted manually or automatically.

This API acknowledges the requested event by clearing GLOBEFLAG sticky flag.
Related APIs:
None

Definition at line 1908 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_DisableModule()

void XMC_VADC_GLOBAL_DisableModule ( void  )
Parameters
None
Returns
None
Description:
Disables the VADC module.

This API would gate the clock to the VADC module (if applicable). Also this API would put the VADC module into the reset state(if applicable) by asserting the appropriate registers. This API would invoke XMC_SCU_CLOCK_GatePeripheralClock() and XMC_SCU_RESET_AssertPeripheralReset() if needed.
Related APIs:
XMC_VADC_GLOBAL_EnableModule().

Definition at line 172 of file xmc_vadc.c.

Here is the call graph for this function:

◆ XMC_VADC_GLOBAL_DisableModuleClock()

__STATIC_INLINE void XMC_VADC_GLOBAL_DisableModuleClock ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrConstant pointer to the VADC module.
Returns
None
Description:
Disables the VADC module clock.

After this API call, no conversion will occur. Call XMC_VADC_GLOBAL_EnableModuleClock() to enable the VADC module later in the program.
Related APIs:
XMC_VADC_GLOBAL_Init()

Definition at line 1507 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_DisableSleepMode()

__STATIC_INLINE void XMC_VADC_GLOBAL_DisableSleepMode ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrConstant pointer to the VADC module.
Returns
None
Description:
Ignores the sleep mode request for the VADC.

With the sleep feature enabled, the module will respond to sleep requests by going into a low power mode. It resets the EDIS bit of CLC register for enabling the sleep mode.
Related APIs:
XMC_VADC_GLOBAL_EnableSleepMode().

Definition at line 1546 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_DisableStartupCalibration()

__STATIC_INLINE void XMC_VADC_GLOBAL_DisableStartupCalibration ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrConstant pointer to the VADC module.
Returns
None
Description:
Disables the startup calibration feature of the VADC module.

It configures the SUCAL bit of GLOBCFG register to disable the startup calibration feature. Calling the API XMC_VADC_GLOBAL_EnsableStartupCalibration() can enable the calibration feature at runtime.
Related APIs:
None

Definition at line 1663 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_EnableModule()

void XMC_VADC_GLOBAL_EnableModule ( void  )
Parameters
None
Returns
None
Description:
Enables the VADC module.

This API would ungate the clock to the VADC module (if applicable). Also this API would bring the VADC module out of reset state(if applicable), by asserting the appropriate registers. This API would invoke XMC_SCU_CLOCK_UngatePeripheralClock() and XMC_SCU_RESET_DeassertPeripheralReset() if needed. Directly accessed register is COMPARATOR.ORCCTRL (Refer to the errata for XMC1100).
Related APIs:
XMC_VADC_GLOBAL_DisableModule().

Definition at line 147 of file xmc_vadc.c.

Referenced by XMC_VADC_GLOBAL_Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XMC_VADC_GLOBAL_EnableModuleClock()

__STATIC_INLINE void XMC_VADC_GLOBAL_EnableModuleClock ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrConstant pointer to the VADC module.
Returns
None
Description:
Enables the VADC module clock.

Call this API before any further configuration of VADC. It sets the DISR bit of CLC register to enable.
Related APIs:
XMC_VADC_GLOBAL_Init()

Definition at line 1487 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_EnableSleepMode()

__STATIC_INLINE void XMC_VADC_GLOBAL_EnableSleepMode ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrConstant pointer to the VADC module.
Returns
None
Description:
Enables VADC module to sleep if a sleep request comes.

It resets the EDIS bit of CLC register for enabling the sleep mode.
Related APIs:
XMC_VADC_GLOBAL_DisableSleepMode().

Definition at line 1526 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_GetCompareResult()

XMC_VADC_FAST_COMPARE_t XMC_VADC_GLOBAL_GetCompareResult ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrConstant pointer to the VADC module
Returns
compare high or low. Refer XMC_VADC_FAST_COMPARE_t enum
None
Description:
Determines the result of fast compare operation.

This API returns the result of fast compare operation provided the valid flag in the global result register GLOBRES is set.
Related APIs:
None

Definition at line 359 of file xmc_vadc.c.

◆ XMC_VADC_GLOBAL_GetDetailedResult()

__STATIC_INLINE uint32_t XMC_VADC_GLOBAL_GetDetailedResult ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrConstant pointer to the VADC module.
Returns
uint32_t Complete global result register value GLOBRES
Description:
Retrieves the complete result from the global result register associated with the global_ptr.

This API audits the result register GLOBRES for the validity of the data. If the validity is assured, data is first read the global result register, cached locally next and subsequently returned to the caller.
Note
You can cast the return to a varible of type XMC_VADC_GLOBAL_DETAILED_RESULT_t to easily access the register bit fields
Related APIs:
XMC_VADC_GLOBAL_GetResult()

Definition at line 1804 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_GetResult()

__STATIC_INLINE XMC_VADC_RESULT_SIZE_t XMC_VADC_GLOBAL_GetResult ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrConstant pointer to the VADC module.
Returns
XMC_VADC_RESULT_SIZE_t 16 bit result register value.
Range[0x0 - 0X0FFF]
Description:
Retrieves the conversion result from the global result register associated with the global_ptr.

This is a lightweight version of XMC_VADC_GLOBAL_GetDetailedResult(). The behavior is exactly the same, just that it is only the 16 bit numeric result returned back to the application instead of the complete GLOBRES register value.
Related APIs:
XMC_VADC_GLOBAL_GetDetailedResult()

Definition at line 1826 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_Init()

void XMC_VADC_GLOBAL_Init ( XMC_VADC_GLOBAL_t *const  global_ptr,
const XMC_VADC_GLOBAL_CONFIG_t *  config 
)
Parameters
global_ptrConstant pointer to the VADC module.
configPointer to initialization data structure
Returns
None
Description:
Initializes the VADC global module with the associated configuration structure pointed by config.

It enables the global access to registers by configuring reset and clock un-gating for selected devices. It initializes global class, boundary , result resources by setting GLOBICLASS,GLOBBOUND,GLOBRCR registers. It also configures the global analog and digital clock dividers by setting GLOBCFG register. Refer related API's to change the configurations later in the program.
Related APIs:
XMC_VADC_GLOBAL_ClockInit()

Definition at line 187 of file xmc_vadc.c.

Referenced by L0_ADC_Config().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XMC_VADC_GLOBAL_InputClassInit()

void XMC_VADC_GLOBAL_InputClassInit ( XMC_VADC_GLOBAL_t *const  global_ptr,
const XMC_VADC_GLOBAL_CLASS_t  config,
const XMC_VADC_GROUP_CONV_t  conv_type,
const uint32_t  set_num 
)
Parameters
global_ptrConstant pointer to the VADC module.
configConversion class parameter structure
conv_typeconfigure the input call for either standard conversion or EMUX related conversion.
set_numConversion class set
Range: [0x0, 0x1]
Description:
Configures the ADC conversion settings like sample time and resolution.

Sets up the conversion settings for vadc global resource associated with config structure. It configures the conversion class properties like sampling time and resolution for selected conv_type channels. It initializes the GLOBALICLASS register specified by set_num with the required settings.
Related APIs:
None

Definition at line 237 of file xmc_vadc.c.

◆ XMC_VADC_GLOBAL_ResultInit()

__STATIC_INLINE void XMC_VADC_GLOBAL_ResultInit ( XMC_VADC_GLOBAL_t *const  global_ptr,
const XMC_VADC_RESULT_CONFIG_t *  config 
)
Parameters
global_ptrConstant pointer to the VADC global module
configPointer to result configuration data structure
Returns
None
Description:
Initializes global result register.

Initializes Global Result Register with specified settings configured in the config structure.

This API results in configuration of GLOBRCR register. This helps in configuring the Data reduction mode, global result event , wait for read mode on the GLOBRES register.
Related APIs:
None

Definition at line 1620 of file xmc_vadc.h.

◆ XMC_VADC_GLOBAL_SetCompareValue()

void XMC_VADC_GLOBAL_SetCompareValue ( XMC_VADC_GLOBAL_t *const  global_ptr,
const XMC_VADC_RESULT_SIZE_t  compare_val 
)
Parameters
global_ptrConstant pointer to the VADC module
compare_valCompare value which the result of a conversion will be compared against.
Range[0x0 - 0X0FFF]
Returns
None
Description:
Set compare value in the global result register for fast compare mode.

The result of a conversion will directly be compared to the compare value entered as part of compare_val. The prerequisite is that the channel associated with this global register must select an ICLASS which has the conversion mode configured as fast compare mode. Call XMC_VADC_GLOBAL_GetCompareResult() after this API to
Related APIs:
None

Definition at line 350 of file xmc_vadc.c.

◆ XMC_VADC_GLOBAL_SetResultEventInterruptNode()

void XMC_VADC_GLOBAL_SetResultEventInterruptNode ( XMC_VADC_GLOBAL_t *const  global_ptr,
XMC_VADC_SR_t  sr 
)
Parameters
global_ptrConstant pointer to the VADC module
srThe service request to which the global result event is connected. Refer XMC_VADC_SR_t enum
Returns
None
Description:
Binds the global result event to one of the 4 shared service requests.

This API binds the global result event to one of the 4 module wide shared service requests .Sets GLOBEVNP register with the corresponding sr line.
Related APIs:
XMC_VADC_GLOBAL_BackgroundSetReqSrcEventInterruptNode()

Definition at line 409 of file xmc_vadc.c.

◆ XMC_VADC_GLOBAL_StartupCalibration()

void XMC_VADC_GLOBAL_StartupCalibration ( XMC_VADC_GLOBAL_t *const  global_ptr)
Parameters
global_ptrConstant pointer to the VADC module.
Returns
None
Description:
Enables the startup calibration feature of the VADC module.

It configures the SUCAL bit of GLOBCFG register to enable the startup calibration feature. After turning it on, it loops until all active groups finish calibration. Call XMC_VADC_GLOBAL_Enable() and XMC_VADC_GLOBAL_ClockInit() before calling this API in sequence. Calling the API XMC_VADC_GLOBAL_DisableStartupCalibration() can disable the calibration feature at runtime.
Related APIs:
XMC_VADC_GLOBAL_Enable()
XMC_VADC_GLOBAL_ClockInit()
None

Definition at line 261 of file xmc_vadc.c.

Referenced by L0_ADC_Config().

Here is the caller graph for this function:

◆ XMC_VADC_GLOBAL_TriggerEvent()

__STATIC_INLINE void XMC_VADC_GLOBAL_TriggerEvent ( XMC_VADC_GLOBAL_t *const  global_ptr,
const uint32_t  event_type 
)
Parameters
global_ptrConstant pointer to the VADC module
event_typeDesired event that must be manually asserted Use the enum XMC_VADC_GLOBAL_EVENT_t to create a mask to be used with this argument
Returns
None
Description:
Manually asserts an event that can lead to an interrupt.

This API manually asserts the requested event (Background request source event or a global result event) by setting the GLOBEVFLAG register with the specified event_type.
Related APIs:
None

Definition at line 1884 of file xmc_vadc.h.